<?php

namespace Catalog;

use Doctrine\ORM\Mapping as ORM;

/**
 * Catalog\News
 *
 * @ORM\Table(name="news")
 * @ORM\Entity
 */
class News
{
    /**
     * @var integer $id
     *
     * @ORM\Column(name="id", type="integer", nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $id;

    /**
     * @var string $title
     *
     * @ORM\Column(name="title", type="string", length=255, nullable=false)
     */
    private $title;

    /**
     * @var text $content
     *
     * @ORM\Column(name="content", type="text", nullable=false)
     */
    private $content;

    /**
     * @var datetime $date
     *
     * @ORM\Column(name="date", type="datetime", nullable=false)
     */
    private $date;

    /**
     * @var string $img
     *
     * @ORM\Column(name="img", type="string", length=255, nullable=true)
     */
    private $img;

    /**
     * @var integer $views
     *
     * @ORM\Column(name="views", type="integer", nullable=false)
     */
    private $views;

    /**
     * @var boolean $public
     *
     * @ORM\Column(name="public", type="boolean", nullable=false)
     */
    private $public;

    /**
     * @var date $publishDate
     *
     * @ORM\Column(name="publish_date", type="date", nullable=false)
     */
    private $publishDate;

    /**
     * @var boolean $top
     *
     * @ORM\Column(name="top", type="boolean", nullable=false)
     */
    private $top;

    /**
     * @var boolean $isDel
     *
     * @ORM\Column(name="is_del", type="boolean", nullable=false)
     */
    private $isDel;

    /**
     * @var string $author
     *
     * @ORM\Column(name="author", type="string", length=45, nullable=false)
     */
    private $author;

    /**
     * @var string $introduction
     *
     * @ORM\Column(name="introduction", type="string", length=1024, nullable=false)
     */
    private $introduction;

    /**
     * @var string $source
     *
     * @ORM\Column(name="source", type="string", length=255, nullable=true)
     */
    private $source;

    /**
     * @var boolean $allowComments
     *
     * @ORM\Column(name="allow_comments", type="boolean", nullable=false)
     */
    private $allowComments;

    /**
     * @var \Doctrine\Common\Collections\ArrayCollection
     *
     * @ORM\ManyToMany(targetEntity="Catalog\Tags", inversedBy="news")
     * @ORM\JoinTable(name="news_tags",
     *   joinColumns={
     *     @ORM\JoinColumn(name="news_id", referencedColumnName="id")
     *   },
     *   inverseJoinColumns={
     *     @ORM\JoinColumn(name="tags_id", referencedColumnName="id")
     *   }
     * )
     */
    private $tags;

    /**
     * @var Catalog\Issue
     *
     * @ORM\ManyToOne(targetEntity="Catalog\Issue")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="issue_id", referencedColumnName="id")
     * })
     */
    private $issue;

    /**
     * @var Catalog\Rubrics
     *
     * @ORM\ManyToOne(targetEntity="Catalog\Rubrics")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="rubric_id", referencedColumnName="id")
     * })
     */
    private $rubric;

    public function __construct()
    {
        $this->tags = new \Doctrine\Common\Collections\ArrayCollection();
    }
    

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set title
     *
     * @param string $title
     * @return News
     */
    public function setTitle($title)
    {
        $this->title = $title;
        return $this;
    }

    /**
     * Get title
     *
     * @return string 
     */
    public function getTitle()
    {
        return $this->title;
    }

    /**
     * Set content
     *
     * @param text $content
     * @return News
     */
    public function setContent($content)
    {
        $this->content = $content;
        return $this;
    }

    /**
     * Get content
     *
     * @return text 
     */
    public function getContent()
    {
        return $this->content;
    }

    /**
     * Set date
     *
     * @param datetime $date
     * @return News
     */
    public function setDate($date)
    {
        $this->date = $date;
        return $this;
    }

    /**
     * Get date
     *
     * @return datetime 
     */
    public function getDate()
    {
        return $this->date;
    }

    /**
     * Set img
     *
     * @param string $img
     * @return News
     */
    public function setImg($img)
    {
        $this->img = $img;
        return $this;
    }

    /**
     * Get img
     *
     * @return string 
     */
    public function getImg()
    {
        return $this->img;
    }

    /**
     * Set views
     *
     * @param integer $views
     * @return News
     */
    public function setViews($views)
    {
        $this->views = $views;
        return $this;
    }

    /**
     * Get views
     *
     * @return integer 
     */
    public function getViews()
    {
        return $this->views;
    }

    /**
     * Set public
     *
     * @param boolean $public
     * @return News
     */
    public function setPublic($public)
    {
        $this->public = $public;
        return $this;
    }

    /**
     * Get public
     *
     * @return boolean 
     */
    public function getPublic()
    {
        return $this->public;
    }

    /**
     * Set publishDate
     *
     * @param date $publishDate
     * @return News
     */
    public function setPublishDate($publishDate)
    {
        $this->publishDate = $publishDate;
        return $this;
    }

    /**
     * Get publishDate
     *
     * @return date 
     */
    public function getPublishDate()
    {
        return $this->publishDate;
    }

    /**
     * Set top
     *
     * @param boolean $top
     * @return News
     */
    public function setTop($top)
    {
        $this->top = $top;
        return $this;
    }

    /**
     * Get top
     *
     * @return boolean 
     */
    public function getTop()
    {
        return $this->top;
    }

    /**
     * Set isDel
     *
     * @param boolean $isDel
     * @return News
     */
    public function setIsDel($isDel)
    {
        $this->isDel = $isDel;
        return $this;
    }

    /**
     * Get isDel
     *
     * @return boolean 
     */
    public function getIsDel()
    {
        return $this->isDel;
    }

    /**
     * Set author
     *
     * @param string $author
     * @return News
     */
    public function setAuthor($author)
    {
        $this->author = $author;
        return $this;
    }

    /**
     * Get author
     *
     * @return string 
     */
    public function getAuthor()
    {
        return $this->author;
    }

    /**
     * Set introduction
     *
     * @param string $introduction
     * @return News
     */
    public function setIntroduction($introduction)
    {
        $this->introduction = $introduction;
        return $this;
    }

    /**
     * Get introduction
     *
     * @return string 
     */
    public function getIntroduction()
    {
        return $this->introduction;
    }

    /**
     * Set source
     *
     * @param string $source
     * @return News
     */
    public function setSource($source)
    {
        $this->source = $source;
        return $this;
    }

    /**
     * Get source
     *
     * @return string 
     */
    public function getSource()
    {
        return $this->source;
    }

    /**
     * Set allowComments
     *
     * @param boolean $allowComments
     * @return News
     */
    public function setAllowComments($allowComments)
    {
        $this->allowComments = $allowComments;
        return $this;
    }

    /**
     * Get allowComments
     *
     * @return boolean 
     */
    public function getAllowComments()
    {
        return $this->allowComments;
    }

    /**
     * Add tags
     *
     * @param Catalog\Tags $tags
     */
    public function addTags(\Catalog\Tags $tags)
    {
        $this->tags[] = $tags;
    }

    /**
     * Get tags
     *
     * @return Doctrine\Common\Collections\Collection 
     */
    public function getTags()
    {
        return $this->tags;
    }

    /**
     * Set issue
     *
     * @param Catalog\Issue $issue
     * @return News
     */
    public function setIssue(\Catalog\Issue $issue = null)
    {
        $this->issue = $issue;
        return $this;
    }

    /**
     * Get issue
     *
     * @return Catalog\Issue 
     */
    public function getIssue()
    {
        return $this->issue;
    }

    /**
     * Set rubric
     *
     * @param Catalog\Rubrics $rubric
     * @return News
     */
    public function setRubric(\Catalog\Rubrics $rubric = null)
    {
        $this->rubric = $rubric;
        return $this;
    }

    /**
     * Get rubric
     *
     * @return Catalog\Rubrics 
     */
    public function getRubric()
    {
        return $this->rubric;
    }
}